package output.txt;

import java.util.ArrayList;

import libutil.filewriter;

import parser.Entry;
import utils.Ids_actions;

public class Energy_output {

	protected ArrayList<Entry> entries;
	
	
	public Energy_output(ArrayList<Entry> entries){
		this.entries = entries;
	}
	
	public void printdata(){
		filewriter writer = new filewriter("temp.txt");
		for(Entry entry : this.entries){
			String temp = ""+entry.getTime()+";";
			if(entry.getMyskill().getSkillevent_id().equals(Ids_actions.restaurer)){
				temp += entry.getMyskill().getNumeric_value()+";";
			}
			if(entry.getMyskill().getSkillevent_id().equals(Ids_actions.depenser)){
				temp += "-"+entry.getMyskill().getNumeric_value()+";";
			}
			writer.insereligne(temp);
		}
		writer.close();
	}
}
